var mongoose = require('mongoose');
var materializedPlugin = require('mongoose-paginate');

var Schema = mongoose.Schema;

var ObjectId = Schema.ObjectId;

var schema = new mongoose.Schema({
    text:String,
    content:String,
    comment:String,
    date:{type:Date,default:Date.now},
    cateId:ObjectId,
    commentCount:Number
});
schema.plugin(materializedPlugin);

var News = mongoose.model('News',schema,'news');

module.exports = News;
